<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base.css">
    <script src="__STATIC__/js/swiper.min.js"></script>
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>热点</title>
    {include file="public/href" /}
</head>
<body>
<div class="wrap-hot">
    <div class="header">
        <p>热点</p>
        <img src="__STATIC__/img_user/back.png" class="back" onclick=window.location.href="{:url('mobile/user_port/index')}";>
    </div>
    <div id="content"></div>
</div>
<script>
    var swiper = new Swiper('.swiper-container', {
        slidesPerView: 3,
        paginationClickable: true,
        spaceBetween: 10,
        freeMode: true
    });
</script>
{include file="public/src" /}
<script>
    //layer流加载
    layui.use('flow', function() {
        var $ = layui.jquery;
        var flow = layui.flow;
        var show = $('#show').val(); //当前浏览的类型
        var sort_type = $('#sort_type').val(); //当前排序的类型
        var search = $('#search').val();
        flow.load({
            elem: '#content' //流加载容器
            ,isAuto:false
            ,isLazyimg:true
            ,done: function(page, next){ //执行下一页的回调
                var lis = [];
                $.ajax({
                    url:"{:url('mobile/user_port/hotSpot')}",
                    dataType:'json',
                    type:'post',
                    data:{'page':page},
                    success:function(t){
                        var url = "{:url('mobile/user_category/goods_details')}";
                        layui.each(t.data, function(index, item){
                            lis.push('<div class="center" onclick=window.location.href="hotSpotDetails?action_id='+item.id+'">' +
                                    '<div class="title"><ul><li class="cir"></li>' +
                                    '<li>'+item.title+'</li>' +
                                    '<li class="cir"></li></ul><span>'+item.create_time+'</span></div>' +
                                    '<div class="content">'+item.content+'</div><div class="swiper-container">' +
                                    '<div class="swiper-wrapper"><div class="swiper-slide" style="width: 33.3%;">' +
                                    '<a href="'+url+'?goods_id='+item["goods"][0].id+'" title="点击进入商品详情"><img src="/'+item.goods[0]["thumb_img"]+'"></a></div>' +
                                    '</div></div></div>');
                        });
                        next(lis.join(''), page < t.pages);
                    },
                    error: function () {
                        layer.open({content:'网络繁忙,请重试',skin:'msg',time:2});
                    }
                })
            }
        });
    });
</script>
</body>
</html>